package admin

import (
	"exercise/application/yiran/app/job"
	"exercise/application/yiran/app/model"
	"github.com/gin-gonic/gin"
)

type adminMenuService struct {
	ctx *gin.Context
}

func (rcv adminMenuService) List() (ret interface{}, err error) {

	list := make([]model.AdminMenuToChild, 0)
	query := model.NewDb("").Query()

	err = query.Where("pid = ?  ", 0).Preload("Child").Find(&list).Error

	//发送消息
	job.NewProduct().Order()

	return list, nil
}

func NewAdminMenuService(c *gin.Context) *adminMenuService {
	return &adminMenuService{}
}
